//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.lyq.bean.mySql;

import java.sql.Connection;
import java.sql.PreparedStatement;

public class AddS_Sql {
    public AddS_Sql() {
    }

    public Boolean addS_Sql(String No, String name, String sex, String age, String collage, String department, String pwd,String campus,Double gpa,int major_id,int year_id) {
        (new MysqlLinking()).getLink();
        Connection conn = MysqlLinking.conn;
        Boolean bool = false;

        try {
            String sql = "insert into student(S_No,S_Name,S_Sex,S_Age,S_Collage,S_Department,S_Pwd,S_campus,gpa,major_id,year_id) values(?,?,?,?,?,?,?,?,?,?,?)";
            PreparedStatement ps = conn.prepareStatement(sql);
            ps.setString(1, No);
            ps.setString(2, name);
            ps.setString(3, sex);
            ps.setString(4, age);
            ps.setString(5, collage);
            ps.setString(6, department);
            ps.setString(7, pwd);
            ps.setString(8, campus);
            ps.setDouble(9, gpa);
            ps.setInt(10, major_id);
            ps.setInt(11, year_id);
            int rs = ps.executeUpdate();
            if (rs > 0) {
                bool = true;
            }

            ps.close();
        } catch (Exception var14) {
            Exception e = var14;
            e.printStackTrace();
        }

        return bool;
    }
}